
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
</head>
<body>
<h1>个人中心</h1>
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/6
 * Time: 10:30
 */

$oldname=$_FILES['file']['name'];
$arr=explode('.',$oldname);
$newname=md5($oldname.time()).'.'.$arr[count($arr)-1];
move_uploaded_file($_FILES['file']['tem_name'], 'public/img/'.$newname);
$img_url='public/img'.$newname;

?>
你的头像是：
<img src="<?php echo $img_url;?>">
</body>

</html>

